/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: UserinfoRepository
 * Author:   pc
 * Date:     2019/9/4 11:14
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.example.rabbitmqdemo.Repository;

import com.example.rabbitmqdemo.entity.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import javax.transaction.Transactional;

/**
 * 〈功能：〉<br>
 * 〈〉
 * @author liuhaoran
 * @create 2019/9/4 11:14
 * @since 1.0.0
 */
public interface UserinfoRepository extends JpaRepository<UserInfo,Long>, JpaSpecificationExecutor<UserInfo> {
	@Transactional
	@Query(value = "select  * from userinfo where userinfo_name=?1 and userinfo_password=?2",nativeQuery = true)
	UserInfo isUserinfo(@Param("userinfoName") String userinfoName, @Param("userinfoPassword")String userinfoPassword);

	@Transactional
	@Query(value = "select  * from userinfo where userinfo_name=?1 ",nativeQuery = true)
	UserInfo findByName(@Param("userinfoName") String userinfoName);
}